package com.code.soulnetty.modbus.client.handler;

import com.code.soulnetty.modbus.biz.ChannelStatus;
import com.code.soulnetty.modbus.client.NettyClient;
import com.code.soulnetty.modbus.client.message.ProtocolResponse;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

import java.util.function.Consumer;

/**
 * @author lyf
 * @date 2022-12-17 17:01
 */
@Slf4j
public class ModbusClientHandler extends SimpleChannelInboundHandler<ProtocolResponse> {

    private int channelId;
    private NettyClient client;

    private Consumer<ChannelStatus> consumer;

    public ModbusClientHandler(int channelId, NettyClient client, Consumer<ChannelStatus> status) {
        this.channelId = channelId;
        this.client = client;
        this.consumer = status;
    }

    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, ProtocolResponse response) throws Exception {

    }
}
